/**
 * list_schema  获取学生列表
 * query_schema 查询学生
 * add_schema   添加学生
 * update_schema  修改学生信息
 */

const joi = require("joi")
const {
  phone,
  s_number,
  password,
  id,
  name,
  page,
  pagesize,
  faculty,
  grade,
  s_class
} = require("../../schema/common")

exports.list_schema = {
  query: {
    page,
    pagesize,
    faculty,
    grade,
    s_class,
  },
}

exports.query_schema = {
  query: {
    s_number: s_number,
  },
}

exports.add_schema = {
  body: {
    s_number: s_number.required(),
    name: name.required(),
    faculty: faculty.required(),
    grade: grade.required(),
    s_class: s_class.required(),
    password: password.required(),
  },
}

exports.update_schema = {
  body: {
    id: id.required(),
    s_number,
    name,
    faculty,
    grade,
    s_class,
    phone,
  },
}
